﻿using System.ComponentModel.DataAnnotations;

namespace FlyingHat.Model.Models
{


    public class BookModel : BookKeyModel
    {
        /// <summary>
        /// 二维码
        /// </summary>
        public string QRCode { get; set; } = string.Empty;

        /// <summary>
        /// 条形码
        /// </summary>
        public string BarCode { get; set; } = string.Empty;

        public string LibraryName { get; set; } = string.Empty;
        public string BookshelfCode { get; set; } = string.Empty;
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; }
    }


    public class BookKeyModel
    {
        public long Id { get; set; }

        /// <summary>
        /// 书名
        /// </summary>
        [Required(ErrorMessage = "图书名称不能为空"), StringLength(50, ErrorMessage = "图书名称最长支持50个字符")]
        public string Name { get; set; } = string.Empty;
        /// <summary>
        /// 作者
        /// </summary>
        [Required(ErrorMessage = "作者不能为空"), StringLength(50, ErrorMessage = "作者最长支持50个字符")]
        public string Author { get; set; } = string.Empty;

        /// <summary>
        /// 封面
        /// </summary>
        [StringLength(100, ErrorMessage = "封面路径最长支持100个字符")]
        public string Cover { get; set; } = string.Empty;

        /// <summary>
        /// ISBN编号
        /// </summary>
        [StringLength(50, ErrorMessage = "ISBN编号最长支持50个字符")]
        public string ISBN { get; set; } = string.Empty;
        /// <summary>
        /// 出版社
        /// </summary>
        [StringLength(50, ErrorMessage = "出版社最长支持50个字符")]
        public string Press { get; set; } = string.Empty;
        /// <summary>
        /// PDF书籍
        /// </summary>
        [StringLength(100, ErrorMessage = "PDF链接最长支持100个字符")]
        public string Pdf { get; set; } = string.Empty;
    }
}
